<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

<button  value="<?php echo $payInfo ?>" onclick="pay(this.value)">H5支付</button>
</body>
<!--<script src="openMidas.js"></script>-->
<script>
    function pay(payInfo){
         //var payInfo = "data=%7B%22appid%22%3A%221013957946%22%2C%22user_id%22%3A%2268686868%22%2C%22out_trade_no%22%3A%2220200114084845693756%22%2C%22product_id%22%3A%22product001%22%2C%22pay_method%22%3A%22wechat%22%7D&sign=ZGBLAeLUun4qCLnepw02CWfrrzKK1nPTW13xCfKgqZZbyT8bLPJ8aVbGEKyysURGlkYcu%2Fx3raEHg7XPAlC0E4BcYzjYgS%2FJeSDCA5ZRQSy1fNmd1F7%2BkZJA9POTLhktd7oRYN8N4gQqYvjJoYEwxDiUqcMSrfiZ6s5moMswzj0un%2BCbELtgDdB%2BW6kUn8AyoylFUh%2FD3F%2F8zRC6PQiRLRnNDj1qPz%2BT9I%2FaPS5ttH3UfhtPODl9b9Ol6QSohZ7GDRnm9NKhheat4XdEhCxMBL%2FYeSaXzyQWRbWLoYh0qAoSeZ%2BW2O%2BgDgMIyFcneexbTg1%2FEzrzh0ft9v44kTWXfQ%3D%3D";


	let env = 'release';
	OpenMidas.init(env);
        var appMetadata = '';
 	 if (env == "test") {
                        window.OpenMidasConfig = {
                            cgiDomain: { [env]: "tymidas.weixiao.qq.com/api" },
                            apiCommonConf: { version: "weixiao" },
                            webDomain: "https://midas.weixiao.qq.com/h5",
                            sandboxWebDomain: "https://midas.weixiao.qq.com/h5"
                        };
                    } else {
                        window.OpenMidasConfig = {
                            cgiDomain: { [env]: "midas.weixiao.qq.com/api" },
                            apiCommonConf: { version: "weixiao" },
                            webDomain: "https://midas.weixiao.qq.com/h5",
                            sandboxWebDomain: "https://midas.weixiao.qq.com/h5"
                        };
                    }
        OpenMidas.pay(payInfo, function(resultCode, innerCode, resultMsg, appMetadata){
            alert(resultCode);
            alert(innerCode);
            alert(resultMsg);
        }, appMetadata);
    }


</script>
</html>

<script src="https://midas.gtimg.cn/openmidas/jsapi/config/openMidasConfig.weixiao.js"></script>
<script src="https://midas.gtimg.cn/openmidas/jsapi/openMidas.js"></script>
